import java.util.Scanner;

public class Test1{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = sc.next();
        int count1 = 0;//大写字母的个数
        int count2 = 0;//小写字母的个数
        int count3 = 0;//数字的个数
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z'){
                count1++;
                continue;
            }
            if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z'){
                count2++;
                continue;
            }
            if (str.charAt(i) >= '0' && str.charAt(i) <= '9'){
                count3++;
                continue;
            }
        }
        System.out.println("大写字母的个数："+count1);
        System.out.println("小写字母的个数："+count2);
        System.out.println("数字的个数："+count3);


    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = sc.next();
        if (str.length() != 8){
            System.out.println("长度不对");
        }else {
            //将字符串中所有大写字母替换成"M"
            String s1 = str.replaceAll("[A-Z]","M");
            System.out.println(s1);
        }
    }
}
